package Function.Utils;

import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.geom.AffineTransform;

public class SwingUtil {
    private static AffineTransform aft = new AffineTransform();

    private static FontRenderContext frc = new FontRenderContext(aft, true, true);

    public static int getStringHeight(String src, Font font){
        return (int)font.getStringBounds(src, frc).getHeight();
    }

    public static int getStringWidht(String src, Font font){
        return (int)font.getStringBounds(src, frc).getWidth();
    }
}
